<div id="tabs">
	<ul>
        <li><?php echo $this->Html->link(__('Chỉ tiêu', true), array('controller' => 'chitieunvs', 'action' => 'hienchitieu',$kehoach_id)); ?> </li>
        <li  id="current"><?php echo $this->Html->link(__('Giao chỉ tiêu', true), array('controller'=>'chitieunvs','action' => 'chonchitieu',$kehoach_id)); ?></li>
	</ul>
</div>
<script type="text/javascript">
$(document).ready(function()
				{
    //text2 la cái class ở ctable
				$(".text2").blur(function(){
				    //1 cái ô
											$cellvalue = $(".cellvalue").val();
											$tong =$('.tong'+$(this).get(0).id).val();
											$value=$(this).val();
											$cellvalue = parseInt($cellvalue,10);
											$tong =parseInt($tong,10);
											$value=parseInt($value,10);
											if (isNaN($cellvalue))
												$cellvalue=0;
											if (isNaN($tong))
												$tong=0;
											if (isNaN($value))
											{
												$value=0;
												$(this).val(0);
											}
											$tong = $tong + $value - $cellvalue;
											$('.tong'+$(this).get(0).id).val($tong);
										});

				$(".text2").focus(function(){
					$(".cellvalue").val($(this).val());
				});
				
				$(".text1").keydown(function(e) {
					arr_key = new Array();
					arr_key[8]=8;
					arr_key[9]=9;
					arr_key[35]=35;
					arr_key[36]=36;
					arr_key[37]=37;
					arr_key[39]=39;
					arr_key[46]=46;
			        if ( arr_key[e.keyCode]!==undefined) {}
			        else {
			            if (e.keyCode < 48 || e.keyCode > 57 ) {
			                e.preventDefault(); 
			            }   
			        }
			    });
				$(".text2").keydown(function(e) {
					arr_key = new Array();
					arr_key[8]=8;
					arr_key[9]=9;
					arr_key[35]=35;
					arr_key[36]=36;
					arr_key[37]=37;
					arr_key[39]=39;
					arr_key[46]=46;
			        if ( arr_key[e.keyCode]!==undefined) {}
			        else {
			            if (e.keyCode < 48 || e.keyCode > 57 ) {
			                e.preventDefault(); 
			            }   
			        }
			    });
				}
	);

</script>
<div class="index">

<?php
if(isset($col_ctdv) && isset($row_ctdv) && isset($datadv) && isset($datadc))
	{
		echo "<h3>Chỉ Tiêu Của Trung Tâm:</h3>";
		echo $ctable->show_2_table($col_dc,$col_ctdv,$row_ctdv,$datadc,$datadv);
	}
else
	echo "<h2>Chi Nhánh Chưa Giao Kế Hoạch Tháng</h2>";
echo "<br>";
if (isset($nhanviens) && isset($hanghoas))
		{   
			echo "</br><h3>Giao Chiêu Tháng Cho Nhân Viên</h3>";
			echo $this->Form->create('Chitieunv',array('url'=>'luuchitieuthang/'.$kehoach_id));
    		echo $ctable->add_2_table('Chitieunv',$col1,$nhanviens,$hanghoas);
    		echo $this->Form->end(__('  Lưu  ', true));
		}
	
 ?>
<?php
	
?>

</div>